﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;

namespace Kiel.Pdf
{
    class CrossReferenceTable : Collection<CrossReferenceEntry>
    {
        public int FirstObjectNumber { get; set; }
        
        public override string ToString()
        {
            StringBuilder text = new StringBuilder();
            text.AppendLine("xref");
            text.AppendFormat("{0} {1}", this.FirstObjectNumber, this.Count);
            foreach (CrossReferenceEntry entry in this)
                text.AppendLine(entry.ToString());
            return text.ToString();
        }
    }
}
